package com.dcm.seckill.mapper;

import com.dcm.seckill.entity.SeckillEntity;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.RequestBody;


import java.util.List;

/**
 * @author 牛浩
 */
@Component
public interface SeckillMapper {
    /**
     * 查询所有
     * @return
     */
    List<SeckillEntity> findAll();

    /**
     * 根据id查一条数据
     * @param mid
     * @return
     */
    SeckillEntity findOne(Long mid);

    /**
     * 根据id修改状态
     * @param mId
     * @param state
     */
    void updateState(@Param("mId") Long mId, @Param("state") Integer state);

    /**
     * 修改所有
     * @param miaosha
     */
    void updat(@RequestBody SeckillEntity miaosha);

    /**
     * 根据id删除
     * @param mId
     */
    void delete(Long mId);

    /**
     * 添加
     * @param miaosha
     */
    void add(@RequestBody SeckillEntity miaosha);

    /**
     * 模糊
     * @param state
     * @param name
     * @return
     */
    List<SeckillEntity> search(@Param("state")Integer state,@Param("name") String name);
}
